Is there built in function in numpy to iterate advanced in 3d array